﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Budgeter.Models;
using System.Configuration;

namespace Budgeter.Helpers
{
    public static class BudgeterContextHelper
    {

        public static BudgeterContext OpenBudgeterContextFromAppConfig()
        {
            var settings = ConfigurationManager.ConnectionStrings["Budgeter"];
            string connectionString = settings.ConnectionString;
            string providerName = settings.ProviderName;

            return new BudgeterContext(providerName, connectionString);
        }
    }

}